import request from '@/utils/request'

// 查询设备列表
export function queryEquip(query) {
    return request({
        url: '/equip/queryEquip',
        method: 'get',
        params: query
    })
}

// 查询设备配置详情
export function getEquipConfigByCode(equipmentCode) {
    return request({
        url: '/equip/getEquipConfigByCode',
        method: 'get',
        params: {
            equipmentCode: equipmentCode
        }
    })
}
// 修改设备配置
export function updateEquipConfig(data) {
    return request({
        url: '/equip/updateEquipConfig',
        method: 'post',
        data: data
    })
}
// 设置设备是否开始采集配置
export function setStartUseFlag(data) {
    return request({
        url: '/equip/setStartUseFlag',
        method: 'post',
        data: data
    })
}

// 查询设备下测点列表
export function queryPoint(query) {
    return request({
        url: '/equip/queryPoint',
        method: 'get',
        params: query
    })
}

// 查询测点详情
export function getPointByCode(pointCode) {
    return request({
        url: '/equip/getPointByCode',
        method: 'get',
        params: {
            pointCode: pointCode
        }
    })
}

// 修改测点
export function updatePoint(data) {
    return request({
        url: '/equip/updatePoint',
        method: 'post',
        data: data
    })
}

// 查询传感器列表
export function queryDevice() {
    return request({
        url: '/equip/queryDevice',
        method: 'get'
    })
}

// 查询传感器详情
export function getDeviceByCode(deviceCode) {
    return request({
        url: '/equip/getDeviceByCode',
        method: 'get',
        params: {
            deviceCode: deviceCode
        }
    })
}

// 修改传感器
export function updateDevice(data) {
    return request({
        url: '/equip/updateDevice',
        method: 'post',
        data: data
    })
}

// 查询测点配置详情
export function getPointFaultByCode(pointCode) {
    return request({
        url: '/equip/getPointFaultByCode',
        method: 'get',
        params: {
            pointCode: pointCode
        }
    })
}